
var mongoose = require('mongoose');
mongoose.Promise = global.Promise;
var connection = require("../../app_modules/dbAccess/appConfig.js");
exports.invokeProcData = function(functionName,MetaData,res) {  	
	var conn = mongoose.createConnection(connection.getConnectionString(""));
	conn.once('open', function () {
		//var db=conn.db;
		db="DatePipe";
		//存储过程调用
		db.eval('DataPipe("'+functionName+'",'+MetaData+')', function(err, result) { 
			if(err)
			{
				console.log('Error:'+ err);
				return;
			}			 
			else{				
			res.json(result);
			}
		});
	})
}